package com.order.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.order.service.colorService;
import com.order.common.R;
import com.order.po.b_color;

@Controller

public class colorController {
	 @Autowired
	  private colorService colorService;
	 
	 @RequestMapping({"/getAllcolor"})
	   @ResponseBody
	   public R getAllcolor()
	   {
		 R r = R.ok().put("data", this.colorService.getAllcolor());
	     return r;
	   }
	 
	 
	 @RequestMapping({"/get_bycolorid"})
	   @ResponseBody
	   public R get_bycolorid(String parameter)
	   {
		 R r = R.ok().put("data", this.colorService.get_bycolorid(parameter));
	     return r;
	   }
	 
	 
	   @RequestMapping({"/update_color"})
	   	@ResponseBody
	   public void update_color(b_color g)
	   {
	     this.colorService.update_color(g);
	   }
	   
	   @RequestMapping({ "/delete_color" })
		@ResponseBody
		public void delete_color(String color_id) {
			this.colorService.delete_color(color_id);
		 }	
	   
	   @RequestMapping({ "/insert_color" })
		@ResponseBody
		public void insert_color(b_color g) {
			this.colorService.insert_color(g);
		 }
}
